import Vue from 'vue'
import App from './App.vue'
import './assets/js/msize.js'
import router from './router'
import './assets/css/_normal.scss'
import './components'     
import {
  Toast,
  Popup,
  DatetimePicker,
  Dialog,
} from 'vant';
Vue.use(Toast).use(Popup).use(DatetimePicker).use(Dialog);
import animated from 'animate.css' 
Vue.use(animated)

// 软键盘弹起bug
import keyboard from '@/utils/softKeyboard'

import Vconsole from 'vconsole'; //移动端调试工具
if (process.env.NODE_ENV == 'development') { // 打包后隐藏
  const vConsole = new Vconsole();
  Vue.use(vConsole);
}
router.beforeEach((to, from, next) => {
  /* 路由发生变化修改页面title */
  if (to.meta.title) {
    document.title = to.meta.title;
  }
  next();
})
if (process.env.NODE_ENV != 'development') {
  console.log = function () {}; //将控制台打印的方法置为空
}

Vue.prototype.$blur = keyboard.blur;
Vue.prototype.$focus = keyboard.focusInput;
// Vue.directive('emoji', keyboard.emoji)
Vue.prototype.$toast = Toast;
Vue.prototype.$Dialog = Dialog;
Vue.config.productionTip = false

new Vue({
  router,
  render: h => h(App),
}).$mount('#app')
